/*
** drop_obj.c for zappy/serv in /home/Smaxo/Travail/zappy-2015-2014s-renard_g/serv-src
**
** Made by maximilien addari
** Login   <addari_m@epitech.net>
**
** Started on  Tue Jul  3 14:54:04 2012 maximilien addari
** Last update Fri Jul 20 09:37:31 2012 guillaume renard
*/

#include	<stdlib.h>

#include	"server.h"

void		drop_obj(t_game *game, long unsigned int time)
{
  unsigned int	i;
  unsigned int	j;
  int		drop;

  time %= game->time - 3;
  if (time > 10)
    time = 10;
  while (time > 0)
  {
    i = rand() % game->coord.x;
    j = rand() % game->coord.y;
    drop = rand() % 100;
    (game->obj[i][j]).inv[(int)game->drop_rate[drop]] += 1;
    time--;
  }
}
